home *** CD-ROM | disk | FTP | other *** search
- AX25 driver for BAYCOM-like modem.
- Version of 4th of January 1992
-
- Free license for this software is granted for _amateur_ use only.
- Commercial usage is prohibited.
-
- AX25.COM is a packet driver comforming (to some extend) to well known
- "FTP packet driver specification". It's purpose is to serve as interface
- between application software (e.g. KA9Q NOS) and a modem connected
- to RS232 port (e.g. BAYCOM modem).
-
- The driver relies on the following RS232 pins:
- RTS - controls PTT: high level activates the transmitter
- DTR - transmitted data. On this pin the driver sends data
- to be transmitted by the modem.
- When in receive state this pin is held high.
- CTS - received data. The modem should supply here the data it receives.
- DCD - the modem may supply here "carrier detect" signal.
- This pin is _optional_ - it is not a must because the driver
- is able to deliver carrier signal from received data.
- GND - a common ground for the above signals.
-
- TxD outputs a signal which is in high (positive voltage)
- most of the time. A low power modem (TCM3105) can be supplied
- from RTS+DTR+TxD (adding realized with diodes).
-
- My primary intention while writting this driver was to provide
- opportunity to run KA9Q NOS with simple modems based on TCM3105
- or AM7910 chip. I tested the driver _only_ with NOS - no other software
- was available at the time. Thus I can not guarantee full compatibility
- with "FTP packet driver" definition.
-
- The driver status can be examined with PKSTAT.COM and the driver can be
- terminated (removed from memory) by TERMIN.COM. These two utilities
- are part of packet drivers package from Clarkson and they should work
- with any "FTP packet driver".
-
- AX25 driver heavily relies on quick interrupt response.
- Thus the application software should avoid disabling
- CPU interrupts for long periods. Or say it in another words:
- enable interrupts whenever possible.
-
- AX25.COM has several start-time options. To see them start it
- with "-?". If you start the driver without any command line
- switch it will use default values: COM1, 1200 baud, etc.
-
- These are the options - default values are in []:
-
- -b<bit rate> [1200] - decimal number
- defines the bit rate. Rates below 300 are not accepted
- because of PC's timer specific features.
- Maximum usable rate is probably 2400 but it really depends
- on your CPU... The upper limit for this parameter is 14400.
- "Valid" rates are only numbers which can be expressed as 14400/n.
- If you give an "invalid" value it will be adjusted to the closest
- "valid" one.
-
- -i<software interrupt> [60] - hexadecimal number
- Tells the driver which software interrupt to use
- for control functions. Usually you would use numbers
- from 60..63 here because these are intended for user applications.
-
- -B<COM port I/O base> [3f8] - hexadecimal number
- I/O address of RS232 port: 3f8 for COM1, 2f8 for COM2
-
- -I<COM port IRQ> [4] - hexadecimal number
- Interrupt request line of RS232 port: 4 for COM1, 3 for COM2
- Only the range 2..7 is supported so far. I'm not sure the irq 2
- would work on a PC/AT.
- After IRQ number you may add letter "p" (like: -I4p).
- This will make the selected IRQ priority highest in the system.
- This may help XT users to get the driver working
- - the future will verify this.
- Normally IRQ0 (system timer) has highest priority.
-
- -s<slot time> [120] - decimal number 16..255
- Slot time for p-persistance scheme. The value is in data bits.
- For 1200 baud, slot time 120 bits means 100 ms.
-
- -p<persistance> [64] - decimal number 0..255
- p-persistance - the higher the value the higher the probability
- of activating PTT at a time slot.
-
- Your station becomes more "agressive" on the air
- with increasing persistance and decreasing slot time.
-
- -h<tx header length> [240] - decimal number 8..65535
- Number of extra bits the transmitter sends before actuall data
- is transmitted. This is same as TxDelay on most TNCs.
- 240 bits means 200 ms at 1200 bps.
-
- You should always make this number as small as possible
- for best bandwidth use. 240 tells you that many "useless"
- bits (30 bytes) are being transmitted before real packet data goes out.
-
- Unlike most TNCs this driver sends a square wave not a series
- of HDLC flags in front of a packet. This was easier to program
- in software and it makes DPLL lock faster at receiving end.
- Thus less header bits should be needed...
-
- -t<tx tail length> [24] - decimal number 8..65535
- Number of extra bits the transmitter sends _after_ the actuall data.
- 24 bits makes 20 ms tx tail.
-
- -c<carrier sense mode> [t] - one of the following letters: f,c,t,d
- mode meaning
-
- f full duplex - transmit whenever data is pending.
- This option disables carrier sensing.
-
- c sense modem DCD line to find out whether channel is busy or not.
- Your modem has to supply this signal. Note that TCM3105
- does not do it very well... it sets DCD to high on any noise
- on audio input. Am7910 is said to deliver much more reliable CD
- signal.
-
- t sense data transition - if incoming data signal moves
- the driver assumes that the channel is busy - BAYCOM 1.5 uses
- the same (or very similar) way with "CARRIER 1" switch.
- Use this mode if you intend to use squelch in your radio.
-
- d deliver "channel busy" status by analysing incoming data.
- BAYCOM's v1.5 "CARRIER 0" does effectively similar thing although
- it uses different algorithm. The driver examines the incoming
- signals "regularity" - if data transitions comes at regular
- intervals the channel is assumed busy.
- With this mode you may run your radio with squelch open
- all the time.
- How this option works may depend on modem type. Some modems
- have still very regular digital output signal even with white
- noise applied to the analog input.
-
- -T<DCD threshold> [50] decimal number 0..100
- Threshold for software DCD (acts only when -cd option is selected)
- The higher the number the "clearer" the signal must be to trigger
- "channel busy" status. You should lower this number if your station
- tends to transmit over others.
-
- -S enable sound effects - when a valid frame is received you will
- hear a short (1/18 sek) beep from PC's speaker.
-
- Please note that argument line is case sensitive and so are hexadecimal
- values... "2F8" will not do - you must specify "2f8".
-
-
- Frequently asked questions with answers.
-
- Q: How to start quickly ?
- A:
- 1. Start the ax25.com - most important parameters are COM base and irq.
- an example for COM1: ax25 -B3f8 -I4
- Now the driver takes control over the RS232 port and stays resident
- waiting for NOS orders...
- 2. Start KA9Q NOS (you need the one supporting packet drivers)
- and then type in:
- ax25 mycall <your callsign>
- attach packet 0x60 ax25 5 512
- trace ax25 111
- you should see packets being received now in trace window
- In most NOS versions you press F9 to get there.
- 3. Try to connect to another station by typing:
- connect ax25 <callsign>
- or split ax25 <callsign> (split window session in JNOS)
-
- This setup in far from complete - it's just to see whether the driver
- cooperates with your hardware and it only allows you to work native AX.25
- Refer to NOS manuals/docs/guides for setting up a complete TCP/IP station.
-
-
- Q: I use -cd option (software DCD) and my station transmits over others
- - it looks like DCD status is always "free channel".
- A:
- Try to lower DCD threshold using -T option. Default value is 50.
-
-
- Q: Are there any programs the driver dislikes ?
- A:
- Yes, SP9AUV discovered a small and nice program saying "Good Morning"
- (in polish) disabled the driver completely on his PC. The reason is a mistery
- as the program is not even resident.
- If the driver does not work, try to start the DOS from a diskette with
- simplest possible config.sys and autoexec.bat and give the driver
- another try.
-
-
- Q: How to change ax25 driver parameters ?
- A:
- If you realized that you have started ax25.com with not the parameters
- you liked use termin.com to terminate the driver (e.g. termin 0x60)
- and start ax25.com again with another option set.
- At the moment there is no way to change the driver's parameters
- after the driver is loaded.
-
-
- Q: Can the ax25 driver be loaded into high RAM ?
- A:
- Yes, the driver can be loaded into UMB to save base memory.
- However on my 386 when I tried to get UMB using EMM386.EXE
- the driver performance become worse even when loaded into low RAM.
- After trying UMBDR521 I got more UMB space (!?) and the driver
- could run both in low and high RAM without any side effects.
-
-
- Q: Can the driver work on an XT ?
- or better: Why the driver does not work on my XT ?!
- A:
- I can't see any reason why not (appart from CPU speed)
- but haven't got a single report about the driver working on an XT.
- In contrary I'm getting lot of claims that "BAYCOM works
- but the ax25 driver does not". I don't understand why...
-
- Suggested solution are:
- 1. Try to specify "p" option after -I - this may help.
- 2. Take KA9Q NOS version from UCSD.EDU - it locks interrupts for
- shorter amount of time when executing timer interrupt.
-
- Q: How to check whether my PC is fast enough ?
- A:
- Do simple loopback by connecting DTR (data out) to CTS (data in).
- Then start the driver at 300 bps and -cf option (full duplex).
- Start the NOS, attach the packet driver (see "How to start quickly")
- and let NOS transmit few packets (for example by enabling beacon
- every 10 sek). Every packet sent should reapear as received in trace window.
- If so try higher speeds, if not either your PC is too slow or something else
- is wrong.
-
-
- Q: How big packets can ax25 driver handle ?
- A:
- The receiver can handle 2048 byte frames.
- This include address, control and data field but not CRC.
- The transmitter buffer can hold up to about 4KB.
- That is the amount of data which can be transmitted
- per each PTT push.
-
-
- Q: How to modify ax25.com buffer's sizes ?
- A:
- You may want to enlarge ax25.com buffers or make them smaller
- to save memory. Go into assembler source ax25.asm which should be included
- in this package - there is a comment about buffers around line 30.
-
-
- Q: How to compile ax25.asm to get ax25.com ?
- A:
- You type in two DOS commands:
- tasm ax25
- tlink /t ax25
-
-
- Q: How to connect my new modem to my RS232 port ?
- A:
- To cooperate with ax25 driver the modem should meet some
- minimal requirements. Basic roules are:
- 1. The modem must provide decoded received data on CTS pin.
- 2. The driver outputs data to be transmitted on DTR pin.
- Modem should modulate and pass this signal to the radio.
- 3. Pin RTS controls the PTT of the radio. When it becomes positive
- the radio (together with the modem) should go into transmition mode.
- 4. Optionally the modem may provide carrier detect signal
- on DCD pin.
- 5. Don't forget about GND line which is the reference for all above signals
-
- BAYCOM and many other modems build around TCM3105 or AM7910/11
- for use with BAYCOM or TFPCX software conform to this scheme.
-
- If you are going to build your own modem you may encounter
- the problem of level conversion. RS232 ports of a PC
- use +/- 12 V while most modem chips need TTl levels (0..+5V).
- The most elegant solution is to use MAX232 or similar converter.
- A simpler (but not that elegant) way of doing conversion is to use
- CMOS inverters (I use 4049 with my TCM3105). Like on the picture below:
-
-
- _____ |\
- RS232 DTR ---|_____|---| \o_____ TTL modem TxD
- 50 or 100 k | /
- |/
-
- _____ /|
- RS232 CTS ---|_____|--o/ |_______ TTL modem RxD
- 0.5 k \ |
- \|
-
-
- _____ /| /|
- RS232 DCD ---|_____|--o/ |___o/ |____ TTL modem DCD
- 0.5 k \ | \ | Modem Tx control
- \| \ ____+5V__ |
- | _|_ | Radio PTT
- Si diode _|_ | | 3M | |
- /_\ |_| | |
- _____ |\ _____ | |+ | | |\ | ___ B |/ C
- RS232 RTS ---|_____|---| \o--|_____|-| |----|----|--| \o---|___|--|
- 50 or 100 k | / 2.2 k | | | / 10 k |\
- |/ 10 uF |/ | E
- -------
- RS232 GND ---o
- |
- _|______ 0V
-
- Inverters are supplied from 0 and +5 Volts - same levels
- as modem TTL part. Note that there are no negative supplies anywhere.
-
- The first scheme _does_ work because CMOS inputs accept voltages outside
- power supply range thanks to input protective diodes.
- The resistor limits the current flowing through these diodes.
- You _must_not_ avoid it !
-
- The second scheme does work as well because the threshold between
- logical states in PC's RS232 is a bit above 0 Volts.
- BAYCOM team recomends HC or HCT series circuits - they must have
- a reason for it but I don't know what it is...
-
- Please note that transmitted and received data polarity is not important
- in packet radio. Only transitions matters. BUT polarity of DCD signal
- DOES matter: positive means "channel is busy - another station transmiting"
- while negative means "channel is free - now we are allowed to transmit".
-
- The last scheme shows PPT circuit with simple watchdog timer. It limits
- the transmition time and is recomended for unattended stations
- to protect against software failures.
-
- It is a good practice to ground unused RS232 inputs (RI, DSR, DCD).
- Due to capacitive coupling to neighbour pins there may apear short spikes
- on them - these will trigger extra interrupts thus loading the CPU.
-
- Another warning: I've seen BAYCOM modem schematics with a transistor
- driving CTS line. This solutions looks good because the
- transistor's collector is supplied with negative voltage delivered
- from TxD. But in practice I had nasty problems with such modems
- when a longer (1 meter) cable was being used... the receiver would
- not decode at all or it would receive only short frames.
-
- The transistor drives CTS well but only when in saturation state.
- In open state CTS becomes very sensitive to any pickup - and the main
- source of pickup is TxD line - there is a square +/- 12V continues wave.
- If your cable is long and there is no shield between the wires
- this wave gets into CTS and makes decoding the true
- modem signal hard... The problem goes away with inverter drivers
- or short or shielded cable between modem and PC.
-
- To find out if TxD really comes into CTS run BAYCOM,
- connect the modem (but no radio) and switch to CARRIER 1 mode
- (not needed for versions prior to 1.5). If you see RECV
- instead of QRV you got the problem...
-
-
-
-
- Have fun and _please_ send success/failure notes
- and comments/hints/complaints to:
-
- email: jalocha@chopin.ifj.edu.pl
- or jalocha@vxcern.cern.ch
- or jalocha@dxcern.cern.ch
- packet: SP9VRC@SP9ZDN.POL.EU (may not work from everywhere)
-
- my home address: Pawel Jalocha
- Rynek Kleparski 14/7
- PL-31150 KRAKOW (Poland)
-
- Pawel, SR9VRC
-
-
- History file
- ===============
-
- First versions on 25-27 of April 1992: first approach to transmitter
- code caused inaccurate data transition timing. After fixing that bug
- another one got in: after transmiting 7KB of data the driver refuses
- to accept packets.
-
-
- 29 April 1992:
-
- More-or-less stable version. Variables aligned to word boudary.
-
-
- 4 May 1992:
-
- Defaults for tx head,tail and slot time are like most TNCs
-
-
- 6 May 1992:
-
- Tx head, tail, slot time are printed out in bits and ms units.
-
-
- August 1992:
-
- An attempt to cure problems occuring on COM ports handling
- IIR register not as I wished they did.
- By the way minor code review.
-
-
- November 1992:
-
- There was a bug (just by mistyping) in version from August 1992
- - when COM interrupt found UART in do-not-need-service state
- it would not issue proper EOI. This could be responsible
- for hangups not present in version of May.
-
- -S option (sound effects) added. Every valid frame received
- makes a 1/18 sek beep.
-
- "p" sub-option after -I added (makes IRQ priority higher)
-
- High-lighting added to some messages. Uses ANSI codes so may cause
- a bit of disorder when ANSI.SYS is not loaded.
-
-
- January 1993
-
- Use byte I/O instead of word I/O when writing baud rate into 8250 UART.
-
- -T option - threshold for software DCD (option -cd)
-
- -cd option improved to be insensitive for asymetry
- in modem's output (bad RXB for TCM3105).
-
- Low pass filter DPLL for clock recovery replaced with random walk DPLL.
- I don't really know which is better... random walk DPLL seems
- to be a bit better... so I leave it in.
-
-